import React from "react";
import { PageHeader } from "antd";
import newslist from "../../../assets/db/newsList";
import './newsDetail.css'

const NewsDetail = (props) => {
    const newsList = newslist.contentlist;
    const {newsId} = props.match.params
    const content = newsList[newsId]
    console.log(content);
    return (
        <>
        <PageHeader 
            onBack={() =>{props.history.goBack()}}
            title="News Detail"
        />
        <div></div>
        <div className="newsDetail">
            <div className="newsDetail-header">
                <div className="newsDetail-title"><h3>{content.title}</h3></div>
                <div className="newsDetail-time"><span>{content.time}</span></div>
            </div>
            <div className="newsDetail-content">
                <div className="content-p">&nbsp;&nbsp;&nbsp;&nbsp;{content.all_list[0].p1}</div>
                <div className="content-img"> <img className="img" src={content.all_list[0].url1} /></div>
                <div className="content-p">&nbsp;&nbsp;&nbsp;&nbsp;{content.all_list[1].p2}</div>
                <div className="content-img"> <img className="img" src={content.all_list[1].url2} /></div>
            </div>
        </div>
        </>
    )
}

export default NewsDetail